home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Freeware 1998 June
/
SGI Freeware 1998 June.iso
/
dist
/
fw_unzip.idb
/
usr
/
freeware
/
catman
/
u_man
/
cat1
/
unzipsfx.Z
/
unzipsfx
Wrap
Text File
|
1998-05-21
|
17KB
|
397 lines
UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL)))) IIIInnnnffffoooo----ZZZZIIIIPPPP ((((3333 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999997777 ((((vvvv5555....33332222)))))))) UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL))))
NNNNAAAAMMMMEEEE
unzipsfx - self-extracting stub for prepending to ZIP
archives
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
<<<<nnnnaaaammmmeeee ooooffff uuuunnnnzzzziiiippppssssffffxxxx++++aaaarrrrcccchhhhiiiivvvveeee ccccoooommmmbbbboooo>>>> [----ccccffffppppttttuuuuzzzz[aaaajjjjnnnnooooqqqqssssCCCCLLLLVVVV$$$$]]
[_f_i_l_e(_s) ... [----xxxx _x_f_i_l_e(_s) ...]]
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_u_n_z_i_p_s_f_x is a modified version of _u_n_z_i_p(1L) designed to be
prepended to existing ZIP archives in order to form self-
extracting archives. Instead of taking its first non-flag
argument to be the zipfile(s) to be extracted, _u_n_z_i_p_s_f_x
seeks itself under the name by which it was invoked and
tests or extracts the contents of the appended archive.
Because the executable stub adds bulk to the archive (the
whole purpose of which is to be as small as possible), a
number of the less-vital capabilities in regular _u_n_z_i_p have
been removed. Among these are the usage (or help) screen,
the listing and diagnostic functions (----llll and ----vvvv), the
ability to decompress older compression formats (the
``reduce,'' ``shrink'' and ``implode'' methods), and the
ability to extract to a directory other than the current
one. Decryption is supported as a compile-time option but
should be avoided unless the attached archive contains
encrypted files.
NNNNooootttteeee tttthhhhaaaatttt sssseeeellllffff----eeeexxxxttttrrrraaaaccccttttiiiinnnngggg aaaarrrrcccchhhhiiiivvvveeeessss mmmmaaaaddddeeee wwwwiiiitttthhhh _u_n_z_i_p_s_f_x aaaarrrreeee nnnnoooo
mmmmoooorrrreeee ((((oooorrrr lllleeeessssssss)))) ppppoooorrrrttttaaaabbbblllleeee aaaaccccrrrroooossssssss ddddiiiiffffffffeeeerrrreeeennnntttt ooooppppeeeerrrraaaattttiiiinnnngggg ssssyyyysssstttteeeemmmmssss
tttthhhhaaaannnn iiiissss tttthhhheeee _u_n_z_i_p eeeexxxxeeeeccccuuuuttttaaaabbbblllleeee iiiittttsssseeeellllffff.... In general a self-
extracting archive made on a particular Unix system, for
example, will only self-extract under the same flavor of
Unix. Regular _u_n_z_i_p may still be used to extract the
embedded archive as with any normal zipfile, although it
will generate a harmless warning about extra bytes at the
beginning of the zipfile. _D_e_s_p_i_t_e _t_h_i_s, however, the self-
extracting archive is technically _n_o_t a valid ZIP archive,
and PKUNZIP may be unable to test or extract it. This
limitation is due to the simplistic manner in which the
archive is created; the internal directory structure is not
updated to reflect the extra bytes prepended to the original
zipfile.
AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
[_f_i_l_e(_s)]
An optional list of archive members to be processed.
Regular expressions (wildcards) similar to those in
Unix _e_g_r_e_p(1) may be used to match multiple members.
These wildcards may contain:
* matches a sequence of 0 or more characters
Page 1 (printed 5/6/98)
UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL)))) IIIInnnnffffoooo----ZZZZIIIIPPPP ((((3333 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999997777 ((((vvvv5555....33332222)))))))) UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL))))
? matches exactly 1 character
[...]
matches any single character found inside the
brackets; ranges are specified by a beginning
character, a hyphen, and an ending character. If
an exclamation point or a caret (`!' or `^')
follows the left bracket, then the range of
characters within the brackets is complemented
(that is, anything _e_x_c_e_p_t the characters inside
the brackets is considered a match).
(Be sure to quote any character that might otherwise be
interpreted or modified by the operating system,
particularly under Unix and VMS.)
[----xxxx _x_f_i_l_e(_s)]
An optional list of archive members to be excluded from
processing. Since wildcard characters match directory
separators (`/'), this option may be used to exclude
any files that are in subdirectories. For example,
``foosfx *.[ch] -x */*'' would extract all C source
files in the main directory, but none in any
subdirectories. Without the ----xxxx option, all C source
files in all directories within the zipfile would be
extracted.
If _u_n_z_i_p_s_f_x is compiled with SFX_EXDIR defined, the
following option is also enabled:
[----dddd _e_x_d_i_r]
An optional directory to which to extract files. By
default, all files and subdirectories are recreated in
the current directory; the ----dddd option allows extraction
in an arbitrary directory (always assuming one has
permission to write to the directory). The option and
directory may be concatenated without any white space
between them, but note that this may cause normal shell
behavior to be suppressed. In particular, ``-d ~''
(tilde) is expanded by Unix C shells into the name of
the user's home directory, but ``-d~'' is treated as a
literal subdirectory ``~~~~'' of the current directory.
OOOOPPPPTTTTIIIIOOOONNNNSSSS
_u_n_z_i_p_s_f_x supports the following _u_n_z_i_p(1L) options: ----cccc and
----pppp (extract to standard output/screen), ----ffff and ----uuuu (freshen
and update existing files upon extraction), ----tttt (test
archive) and ----zzzz (print archive comment). All normal listing
options (----llll, ----vvvv and ----ZZZZ) have been removed, but the testing
option (----tttt) may be used as a ``poor man's'' listing.
Alternatively, those creating self-extracting archives may
wish to include a short listing in the zipfile comment.
Page 2 (printed 5/6/98)
UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL)))) IIIInnnnffffoooo----ZZZZIIIIPPPP ((((3333 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999997777 ((((vvvv5555....33332222)))))))) UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL))))
See _u_n_z_i_p(1L) for a more complete description of these
options.
MMMMOOOODDDDIIIIFFFFIIIIEEEERRRRSSSS
_u_n_z_i_p_s_f_x currently supports all _u_n_z_i_p(1L) modifiers: ----aaaa
(convert text files), ----nnnn (never overwrite), ----oooo (overwrite
without prompting), ----qqqq (operate quietly), ----CCCC (match names
case-insenstively), ----LLLL (convert uppercase-OS names to
lowercase), ----jjjj (junk paths) and ----VVVV (retain version numbers);
plus the following operating-system specific options: ----XXXX
(restore VMS owner/protection info), ----ssss (convert spaces in
filenames to underscores [DOS, OS/2, NT]) and ----$$$$ (restore
volume label [DOS, OS/2, NT, Amiga]).
(Support for regular ASCII text-conversion may be removed in
future versions, since it is simple enough for the archive's
creator to ensure that text files have the appropriate
format for the local OS. EBCDIC conversion will of course
continue to be supported since the zipfile format implies
ASCII storage of text files.)
See _u_n_z_i_p(1L) for a more complete description of these
modifiers.
EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT OOOOPPPPTTTTIIIIOOOONNNNSSSS
_u_n_z_i_p_s_f_x uses the same environment variables as _u_n_z_i_p(1L)
does, although this is likely to be an issue only for the
person creating and testing the self-extracting archive.
See _u_n_z_i_p(1L) for details.
DDDDEEEECCCCRRRRYYYYPPPPTTTTIIIIOOOONNNN
Decryption is supported exactly as in _u_n_z_i_p(1L); that is,
interactively with a non-echoing prompt for the password(s).
See _u_n_z_i_p(1L) for details. Once again, note that if the
archive has no encrypted files there is no reason to use a
version of _u_n_z_i_p_s_f_x with decryption support; that only adds
to the size of the archive.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
To create a self-extracting archive _l_e_t_t_e_r_s from a regular
zipfile _l_e_t_t_e_r_s._z_i_p and change the new archive's permissions
to be world-executable under Unix:
cat unzipsfx letters.zip > letters
chmod 755 letters
zip -A letters
To create the same archive under MS-DOS, OS/2 or NT (note
the use of the ////bbbb [binary] option to the _c_o_p_y command):
copy /b unzipsfx.exe+letters.zip letters.exe
zip -A letters.exe
Page 3 (printed 5/6/98)
UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL)))) IIIInnnnffffoooo----ZZZZIIIIPPPP ((((3333 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999997777 ((((vvvv5555....33332222)))))))) UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL))))
Under VMS:
copy unzipsfx.exe,letters.zip letters.exe
letters == "$currentdisk:[currentdir]letters.exe"
zip -A letters.exe
(The VMS _a_p_p_e_n_d command may also be used. The second
command installs the new program as a ``foreign command''
capable of taking arguments. The third line assumes that
Zip is already installed as a foreign command.) Under
AmigaDOS:
MakeSFX letters letters.zip UnZipSFX
(MakeSFX is included with the UnZip source distribution and
with Amiga binary distributions. ``zip -A'' doesn't work on
Amiga self-extracting archives.) To test (or list) the
newly created self-extracting archive:
letters -t
To test _l_e_t_t_e_r_s quietly, printing only a summary message
indicating whether the archive is OK or not:
letters -tqq
To extract the complete contents into the current directory,
recreating all files and subdirectories as necessary:
letters
To extract all *.txt files (in Unix quote the `*'):
letters *.txt
To extract everything _e_x_c_e_p_t the *.txt files:
letters -x *.txt
To extract only the README file to standard output (the
screen):
letters -c README
To print only the zipfile comment:
letters -z
LLLLIIIIMMMMIIIITTTTAAAATTTTIIIIOOOONNNNSSSS
The principle and fundamental limitation of _u_n_z_i_p_s_f_x is that
it is not portable across architectures or operating
systems, and therefore neither are the resulting archives.
Page 4 (printed 5/6/98)
UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL)))) IIIInnnnffffoooo----ZZZZIIIIPPPP ((((3333 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999997777 ((((vvvv5555....33332222)))))))) UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL))))
For some architectures there is limited portability, however
(e.g., between some flavors of Intel-based Unix).
Another problem with the current implementation is that any
archive with ``junk'' prepended to the beginning technically
is no longer a zipfile (unless _z_i_p(1) is used to adjust the
zipfile offsets appropriately, as noted above). _u_n_z_i_p(1)
takes note of the prepended bytes and ignores them since
some file-transfer protocols, notably MacBinary, are also
known to prepend junk. But PKWARE's archiver suite may not
be able to deal with the modified archive unless its offsets
have been adjusted.
_u_n_z_i_p_s_f_x has no knowledge of the user's PATH, so in general
an archive must either be in the current directory when it
is invoked, or else a full or relative path must be given.
If a user attempts to extract the archive from a directory
in the PATH other than the current one, _u_n_z_i_p_s_f_x will print
a warning to the effect, ``can't find myself.'' This is
always true under Unix and may be true in some cases under
MS-DOS, depending on the compiler used (Microsoft C fully
qualifies the program name, but other compilers may not).
Under OS/2 and NT there are operating-system calls available
that provide the full path name, so the archive may be
invoked from anywhere in the user's path. The situation is
not known for AmigaDOS, Atari TOS, MacOS, etc.
As noted above, a number of the normal _u_n_z_i_p(1L) functions
have been removed in order to make _u_n_z_i_p_s_f_x smaller: usage
and diagnostic info, listing functions and extraction to
other directories. Also, only stored and deflated files are
supported. The latter limitation is mainly relevant to
those who create SFX archives, however.
VMS users must know how to set up self-extracting archives
as foreign commands in order to use any of _u_n_z_i_p_s_f_x's
options. This is not necessary for simple extraction, but
the command to do so then becomes, e.g., ``run letters'' (to
continue the examples given above).
_u_n_z_i_p_s_f_x on the Amiga requires the use of a special program,
MakeSFX, in order to create working self-extracting
archives; simple concatenation does not work. (For
technically oriented users, the attached archive is defined
as a ``debug hunk.'') There may be compatibility problems
between the ROM levels of older Amigas and newer ones.
All current bugs in _u_n_z_i_p(1L) exist in _u_n_z_i_p_s_f_x as well.
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
_u_n_z_i_p_s_f_x's exit status (error level) is identical to that of
_u_n_z_i_p(1L); see the corresponding man page.
Page 5 (printed 5/6/98)
UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL)))) IIIInnnnffffoooo----ZZZZIIIIPPPP ((((3333 NNNNoooovvvveeeemmmmbbbbeeeerrrr 1111999999997777 ((((vvvv5555....33332222)))))))) UUUUNNNNZZZZIIIIPPPPSSSSFFFFXXXX((((1111LLLL))))
SSSSEEEEEEEE AAAALLLLSSSSOOOO
_f_u_n_z_i_p(1L), _u_n_z_i_p(1L), _z_i_p(1L), _z_i_p_c_l_o_a_k(1L), _z_i_p_g_r_e_p(1L),
_z_i_p_i_n_f_o(1L), _z_i_p_n_o_t_e(1L), _z_i_p_s_p_l_i_t(1L)
UUUURRRRLLLL
The Info-ZIP home page is currently at
http://www.cdrom.com/pub/infozip/ .
AAAAUUUUTTTTHHHHOOOORRRRSSSS
Greg Roelofs was responsible for the basic modifications to
UnZip necessary to create UnZipSFX. See _u_n_z_i_p(1L) for the
current list of Zip-Bugs authors, or the file CONTRIBS in
the UnZip source distribution for the full list of Info-ZIP
contributors.
Page 6 (printed 5/6/98)